import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import LARView from '../views/LoginAndRegister.vue'
import QuestionDetail from '../views/QuestionDetail.vue'
import HomeView from '../views/HomeView.vue'
import SearchView from '../views/SearchView.vue'
import Message from '../views/Message.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'index',
    component: LARView
  },
  {
    path: '/mainPage',
    name: 'mainPage',
    component: HomeView
  },
  {
    path: '/Personal',
    name: 'personal',
    component: () => import ('../views/Personal.vue')
  },
  {
    path: '/searchPage',
    name: 'searchPage',
    component: SearchView
  },
  {
    path: '/QuestionDetail',
    name: 'QuestionDetail',
    component: QuestionDetail
  },
  {
    path: '/editAnswer',
    name: 'editAnswer',
    component: () => import ('@/views/EditAnswerView.vue')
  },
  {
    path: '/message',
    name: 'message',
    component: Message
  },
  {
    path: '/other',
    name: 'other',
    component: () => import('../views/Other.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

// @ts-ignore
export default router
